package br.com.sig.cadastro.fretista.presentation.action;

import javax.annotation.PostConstruct;
import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;

import br.com.sig.cadastro.fretista.business.model.bo.FretistaBO;
import br.com.sig.cadastro.fretista.business.model.entity.Fretista;
import br.com.sig.cadastro.pessoas.business.model.entity.PessoaFisica;
import br.com.sig.presentation.action.BaseListAction;

@Named
@ViewScoped
public class FretistaList extends BaseListAction<Fretista> {
	
	private static final long serialVersionUID = -2946679964621239472L;
	
	@Inject
	private FretistaBO fretistaBO;
	
	@PostConstruct
	public void init() {
		setService(fretistaBO);
	}
	
	@Override
	protected Fretista createInstance() {
		Fretista fretista = super.createInstance();
		fretista.setPessoaFisica(new PessoaFisica());
		return fretista;
	}	
}